﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

using Microsoft.Phone.Controls.Maps;
using Microsoft.Phone.Controls.Maps.Platform;

namespace SmartHYU_TestVersion.Life
{
    public partial class Map : PhoneApplicationPage
    {
        Location hyuLocation = new Location()
        {
            Longitude = 127.0467,
            Latitude = 37.55693,
        };
        MapLayer legendLayer = new MapLayer();


        public Map()
        {
            InitializeComponent();
        }

        private void mapForHyu_Loaded(object sender, RoutedEventArgs e)
        {
            // Map settings
            mapForHyu.Mode = new AerialMode();
            mapForHyu.SetView(hyuLocation, 16.0);

            // Map Legends
            Location legendPosition = new Location();
            legendPosition.Longitude = hyuLocation.Longitude - 0.002;
            legendPosition.Latitude = hyuLocation.Latitude - 0.001;

            TextBlock legendText = new TextBlock();
            legendText.Text = "Hanyang University";
            legendText.FontSize = 30;
            legendText.Foreground = new SolidColorBrush(Colors.White);
            legendText.FontWeight = FontWeights.Bold;

            legendLayer.AddChild(legendText, legendPosition);

            mapForHyu.Children.Add(legendLayer);
            
        }
    }
}